package com.qeado.admin.dao.ibatis;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.qeado.admin.dao.UserInfoDao;
import com.qeado.admin.model.UserInfo;
import com.qeado.common.dao.BaseDao;

@Repository
@SuppressWarnings("unchecked")
public class UserInfoDaoImpl extends BaseDao implements UserInfoDao{

	public void deleteUser(String id) {
		getSqlMapClientTemplate().update("deleteUser",id);
	}

	public void saveUser(UserInfo userInfo) {
		getSqlMapClientTemplate().insert("saveUser",userInfo);
	}

	public UserInfo selectUser(String id) {
		return (UserInfo)getSqlMapClientTemplate().queryForObject("selectUser", id);
	}

	public void updateUser(UserInfo userInfo) {
		getSqlMapClientTemplate().update("updateUser",userInfo);
	}

	public List<UserInfo> userSearch(UserInfo userInfo) {
		return (List<UserInfo>)getSqlMapClientTemplate().queryForList("userSearch", userInfo);
	}

	@Override
	public Object searchUserInfoByUsername(UserInfo userInfo) {
		return getSqlMapClientTemplate().queryForObject("searchUserInfoByUsername", userInfo);
	}

	@Override
	public List<UserInfo> searchUserCompanyList(UserInfo userInfo) {
		return (List<UserInfo>)getSqlMapClientTemplate().queryForList("searchUserCompanyList", userInfo);
	}

	@Override
	public List<UserInfo> searchUserCollegeList(UserInfo userInfo) {
		return (List<UserInfo>)getSqlMapClientTemplate().queryForList("searchUserCollegeList", userInfo);
	}

}
